using FeishuWorkflowService.Models;

namespace FeishuWorkflowService.Services
{
    public interface IFeishuService
    {
        /// <summary>
        /// 获取飞书访问令牌
        /// </summary>
        /// <returns>访问令牌</returns>
        Task<string> GetAccessTokenAsync();

        /// <summary>
        /// 获取审批流程详情
        /// </summary>
        /// <returns>访问令牌</returns>
        Task<WorkflowTemplate> GetWorkflowTemplateDetailAsync(string ApprovalTemplateNode);

        /// <summary>
        /// 创建审批流程实例
        /// </summary>
        /// <param name="request">创建流程请求</param>
        /// <returns>流程实例ID</returns>
        Task<string> CreateWorkflowInstanceAsync(CreateWorkflowRequest request);

        /// <summary>
        /// 查询审批流程状态
        /// </summary>
        /// <param name="instanceId">流程实例ID</param>
        /// <returns>流程状态</returns>
        Task<WorkflowStatus> GetWorkflowStatusAsync(string instanceId);

        /// <summary>
        /// 验证回调签名
        /// </summary>
        /// <param name="timestamp">时间戳</param>
        /// <param name="nonce">随机字符串</param>
        /// <param name="signature">签名</param>
        /// <returns>是否验证通过</returns>
        bool VerifySignature(string timestamp, string nonce, string signature);
    }
}